package com.hr.controller;


import com.hr.domain.dto.UserLoginDTO;
import com.hr.result.Result;
import com.hr.service.IUserService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author LuoQiu
 * @since 2024-09-17
 */
@RestController
@RequestMapping("/sys")
public class UserController {

    @Resource
    private IUserService userService;

    @ApiOperation(value = "登录")
    @PostMapping("/login")
    public Result<String> loginInfo(@RequestBody UserLoginDTO userLoginDTO) {
        String token  =  userService.loginInfo(userLoginDTO);
        return Result.success(token);
    }

}
